var i;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var BundleConfig = require("AA_BundleConfig");
var ResKeeper = require("AA_ResKeeper");
var CommonUtils = require("AA_CommonUtils");
var Excel = require("AA_Excel");
var HallGlobalVariable = require("AA_HallGlobalVariable");
var _decorator = cc._decorator;
var _ccclass = _decorator.ccclass;
var _property = _decorator.property;

var _def_UI_GameOverItem = function (e) {
  function _creator() {
    var t = null !== e && e.apply(this, arguments) || this;
    t.icon = null;
    t.quality = null;
    t.countLb = null;
    return t;
  }
  __extends(_creator, e);
  _creator.prototype.onEnable = function () { };
  _creator.prototype.initUi = function (e, t) {
    return __awaiter(this, undefined, undefined, function () {
      var o;
      var n;
      var i;
      var a = this;
      return __generator(this, function (r) {
        switch (r.label) {
          case 0:
            switch (e) {
              case HallGlobalVariable.default.goldId:
                return [3, 1];
              case 12345:
                return [3, 3];
            }
            return [3, 5];
          case 1:
            return [4, this._loadRes(BundleConfig.BundleNames.Common, "common/" + "res/ui/tu/goldIcon", cc.SpriteFrame)];
          case 2:
            o = r.sent();
            this._loadRes(BundleConfig.BundleNames.Common, "common/" + "res/quality/quality_m_1", cc.SpriteFrame).then(function (e) {
              a.quality.spriteFrame = e;
            });
            this.icon.spriteFrame = o;
            return [3, 6];
          case 3:
            return [4, this._loadRes(BundleConfig.BundleNames.Common, "common/" + "res/ui/tu/jifen", cc.SpriteFrame)];
          case 4:
            n = r.sent();
            this._loadRes(BundleConfig.BundleNames.Common, "common/" + "res/quality/quality_m_3", cc.SpriteFrame).then(function (e) {
              a.quality.spriteFrame = e;
            });
            this.icon.spriteFrame = n;
            return [3, 6];
          case 5:
            i = Excel.Excel.shuiguo(e).quality;
            this._loadRes(BundleConfig.BundleNames.Common, "common/" + "res/player/player" + (e - 1e3) + "_1", cc.SpriteFrame).then(function (e) {
              a.icon.spriteFrame = e;
              CommonUtils.default.LimitSpriteMaxSize(a.icon, 100);
            });
            this._loadRes(BundleConfig.BundleNames.Common, "common/" + "res/quality/quality_" + i, cc.SpriteFrame).then(function (e) {
              a.quality.spriteFrame = e;
            });
            return [3, 6];
          case 6:
            this.countLb.string = "×" + t;
            return [2];
        }
      });
    });
  };
  __decorate([_property(cc.Sprite)], _creator.prototype, "icon", undefined);
  __decorate([_property(cc.Sprite)], _creator.prototype, "quality", undefined);
  __decorate([_property(cc.Label)], _creator.prototype, "countLb", undefined);
  return __decorate([_ccclass], _creator);
}(ResKeeper.default);
exports.default = _def_UI_GameOverItem;